{% extends "base.html" %}

{% set active_page = "Database" %}

{% block body %}


<div class="row">

    <div class="col-xs-offset-2 col-md-8">
        <h2>Search Firmware Database</h2>
        <form class="form-horizontal" action="" method=post enctype=multipart/form-data>

            <div class="form-group">
                <label class="control-label col-xs-3" for="device_class">Device Class:</label>
                <div class="col-xs-9">
                    <select class="form-control" name='device_class_dropdown' id="device_class">
                        <option value=''></option>
                        {% for class in device_classes | sort %}
                            <option value='{{ class }}'>{{ class }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="control-label col-xs-3" for="device_class">Vendor:</label>
                <div class="col-xs-9">
                    <select class="form-control" name='vendor' id="vendor">
                        <option value=''></option>
                        {% for vendor in vendors | sort %}
                            <option value='{{ vendor }}'>{{ vendor }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>

            {% set input_form_text = [
                ("File Name", "file_name"),
                ("Device Name", "device_name"),
                ("Firmware Version", "version"),
                ("Release Date", "release_date"),
                ("Hash", "hash_value")
            ] -%}
            {% for label, id in input_form_text %}
            <div class="form-group">
                <label class="control-label col-xs-3" for="{{ id }}">{{ label }}:</label>
                <div class="col-xs-9">
                    <input type="text" name="{{ id }}" class="form-control" id="{{ id }}" placeholder="{{ label }}">
                </div>
            </div>
            {% endfor %}

            <button type="submit" value=submit class="btn btn-default" id="input_submit" onclick='showImg()'>
                <span class="glyphicon glyphicon-search"></span> Search
            </button>

        </form>
    </div>
</div>

{% endblock %}